<template>
    <block >
        <goods-card :goodsList="lists" type="row"></goods-card>
         
    </block>
</template>

<script lang="ts" setup>
import { getGoodsByCouponId } from '@/api';
import { onLoad } from '@dcloudio/uni-app';
import Card from './card.vue'
import GoodsCard from '@/components/goods-card/index.vue'
import { ref } from 'vue';


onLoad((options)=>{
    getlist(options.id)
})
let lists = ref();
const baseUrl = ref(`${import.meta.env.VITE_APP_BASE_URL || ''}/api/uploads/`)
const getlist = async (id:any)=>{
   let res = await getGoodsByCouponId(id);
   console.log(res)
   res.forEach((e:any)=>{
    e.image = baseUrl.value + e.image
   })
   lists.value = res;
}

/* const props = defineProps({
    lists: {
        type: Array,
        default: []
    },
	googsname: {
	    type: String,
	    default: '服务'
	}
})
 
console.log('lists1111111111', props.lists) */
</script>

<style></style>
